<template>
    <view class="tabs">
        <view
            v-for="(tab, index) in tabs"
            class="tab-item"
            :class="tabIndex == index && 'active'"
            @click="clickTab(tab, index)"
            :key="index">
            <text class="tab-item-text">{{ tab.title }}</text>
            <view class="line"></view>
        </view>
    </view>
</template>

<script>
export default {
    props: ["tabIndex", "tabs"],
    data() {
        return {}
    },
    methods: {
        clickTab(item, index) {
            this.$emit("clickTab", index)
        },
    },
}
</script>

<style lang="scss"></style>
